/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "paper_attribute_group" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "PaperAttributeGroup.findAll" , query = "SELECT p FROM PaperAttributeGroup p" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByAgId" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.agId = :agId" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByAgName" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.agName = :agName" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByStatus" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.status = :status" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByMaxLength" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.maxLength = :maxLength" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findBySegmentWidth" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.segmentWidth = :segmentWidth" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByNumSegments" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.numSegments = :numSegments" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByInitialValue" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.initialValue = :initialValue" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findBySegmentColorPattern" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.segmentColorPattern = :segmentColorPattern" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByTickPattern" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.tickPattern = :tickPattern" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByFormatCharacterPattern" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.formatCharacterPattern = :formatCharacterPattern" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByJustification" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.justification = :justification" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByDateCreated" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByCreatedBy" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.createdBy = :createdBy" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByDateModified" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.dateModified = :dateModified" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByModifiedBy" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "PaperAttributeGroup.findByUseInKfi" , query = "SELECT p FROM PaperAttributeGroup p WHERE p.useInKfi = :useInKfi" )
} )
public class PaperAttributeGroup implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "ag_id" )
    private String agId;
    @Basic( optional = false )
    @Column( name = "ag_name" )
    private String agName;
    @Basic( optional = false )
    @Column( name = "status" )
    private String status;
    @Column( name = "max_length" )
    private Short maxLength;
    @Column( name = "segment_width" )
    private String segmentWidth;
    @Column( name = "num_segments" )
    private Short numSegments;
    @Column( name = "initial_value" )
    private String initialValue;
    @Column( name = "segment_color_pattern" )
    private String segmentColorPattern;
    @Column( name = "tick_pattern" )
    private String tickPattern;
    @Column( name = "format_character_pattern" )
    private String formatCharacterPattern;
    @Column( name = "justification" )
    private String justification;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "use_in_kfi" )
    private String useInKfi;
    @JoinColumn( name = "widget_id" , referencedColumnName = "widget_id" )
    @ManyToOne
    private GraphicalWidgets widgetId;
    @OneToMany( mappedBy = "agIdPaper" )
    private Collection<CustomResponses> customResponsesCollection;


    public PaperAttributeGroup()
    {
    }


    public PaperAttributeGroup( String agId )
    {
        this.agId = agId;
    }


    public PaperAttributeGroup( String agId , String agName , String status , Date dateCreated , String createdBy )
    {
        this.agId = agId;
        this.agName = agName;
        this.status = status;
        this.dateCreated = dateCreated;
        this.createdBy = createdBy;
    }


    public String getAgId()
    {
        return agId;
    }


    public void setAgId( String agId )
    {
        this.agId = agId;
    }


    public String getAgName()
    {
        return agName;
    }


    public void setAgName( String agName )
    {
        this.agName = agName;
    }


    public String getStatus()
    {
        return status;
    }


    public void setStatus( String status )
    {
        this.status = status;
    }


    public Short getMaxLength()
    {
        return maxLength;
    }


    public void setMaxLength( Short maxLength )
    {
        this.maxLength = maxLength;
    }


    public String getSegmentWidth()
    {
        return segmentWidth;
    }


    public void setSegmentWidth( String segmentWidth )
    {
        this.segmentWidth = segmentWidth;
    }


    public Short getNumSegments()
    {
        return numSegments;
    }


    public void setNumSegments( Short numSegments )
    {
        this.numSegments = numSegments;
    }


    public String getInitialValue()
    {
        return initialValue;
    }


    public void setInitialValue( String initialValue )
    {
        this.initialValue = initialValue;
    }


    public String getSegmentColorPattern()
    {
        return segmentColorPattern;
    }


    public void setSegmentColorPattern( String segmentColorPattern )
    {
        this.segmentColorPattern = segmentColorPattern;
    }


    public String getTickPattern()
    {
        return tickPattern;
    }


    public void setTickPattern( String tickPattern )
    {
        this.tickPattern = tickPattern;
    }


    public String getFormatCharacterPattern()
    {
        return formatCharacterPattern;
    }


    public void setFormatCharacterPattern( String formatCharacterPattern )
    {
        this.formatCharacterPattern = formatCharacterPattern;
    }


    public String getJustification()
    {
        return justification;
    }


    public void setJustification( String justification )
    {
        this.justification = justification;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public String getUseInKfi()
    {
        return useInKfi;
    }


    public void setUseInKfi( String useInKfi )
    {
        this.useInKfi = useInKfi;
    }


    public GraphicalWidgets getWidgetId()
    {
        return widgetId;
    }


    public void setWidgetId( GraphicalWidgets widgetId )
    {
        this.widgetId = widgetId;
    }


    @XmlTransient
    public Collection<CustomResponses> getCustomResponsesCollection()
    {
        return customResponsesCollection;
    }


    public void setCustomResponsesCollection( Collection<CustomResponses> customResponsesCollection )
    {
        this.customResponsesCollection = customResponsesCollection;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( agId != null ? agId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof PaperAttributeGroup ) )
        {
            return false;
        }
        PaperAttributeGroup other = (PaperAttributeGroup) object;
        if ( ( this.agId == null && other.agId != null ) || ( this.agId != null && !this.agId.equals( other.agId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.PaperAttributeGroup[ agId=" + agId + " ]";
    }
    
}
